package com.blockmeta.bbs.businesslibrary.net.pojo;

import android.text.TextUtils;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by author on 2018/1/8.
 */

public class InforPOJO {
    /**
     * author_info : {"desc":"趣会翻译编辑，邮箱wendy@8btc.com，微信号wendyes，欢迎提供比特币和区块链资讯信息。比特币地址：1AAjfpii34M4SHe8YbY45Tx32pd6TT2weZ","post_count":1419,"comment_count":4235,"support_count":15}
     * list : [{"mID":158439,"post_name":"court-bitcoin-economic-value","title":"虚拟货币具有经济价值！韩国法院允许检方没收比特币  ","post_date":"1517457995","post_date_format":"2018-02-01 12:06:35","desc":"韩国法院首次判定比特币具有经济价值，这就推翻了其之前的判决（不承认比特币）。这起案件涉及191个比特币的扣押程序。\r\n\r\n\r\n\r\n&nbsp;\r\n比特币性质的定义\r\n&nbsp...","image":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2018/02/201802010405197045-380x228.jpg","content":"","author_info":{"mID":"14582","name":"王雯敏Wendy","display_name":"Wendy","desc":"","bitcoin_address":"","avatar":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2016/05/王雯敏Wendy_avatar_1462506024-96x96.jpg"},"category":[{"mID":"572","name":"法律政策"}],"replies":"1","getViews":"486","source":""},{"mID":158412,"post_name":"south-korea-crypto-crime","title":"韩国海关集中火力打击加密货币罪案，查处近6亿美元非法交易","post_date":"1517454693","post_date_format":"2018-02-01 11:11:33","desc":"韩国海关今日宣布，其查获的\u201c加密货币罪案\u201d涉及的资金达到了6亿美元。\r\n\r\n&nbsp;\r\n打击加密货币罪案\r\n&nbsp;\r\n\r\n据路透社报道，韩国海关总署（KCS）发布公告...","image":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2018/02/201802010309058077-380x228.jpg","content":"","author_info":{"mID":"14582","name":"王雯敏Wendy","display_name":"Wendy","desc":"","bitcoin_address":"","avatar":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2016/05/王雯敏Wendy_avatar_1462506024-96x96.jpg"},"category":[{"mID":"7","name":"比特币"}],"replies":"1","getViews":"1148","source":""},{"mID":158175,"post_name":"john-mcafee-us-dollar-bitcoin","title":"John McAfee：比特币不是骗局，美元才是","post_date":"1517391233","post_date_format":"2018-01-31 17:33:53","desc":"John McAfee表示，政府和传统银行都很害怕加密货币，因为它们将取代并且改革当前的财富分配状况。\r\n\r\n\r\n\r\n在接受采访时，John McAfee提到，比特币不是骗局...","image":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2018/01/201801310933036418-380x228.jpg","content":"","author_info":{"mID":"14582","name":"王雯敏Wendy","display_name":"Wendy","desc":"","bitcoin_address":"","avatar":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2016/05/王雯敏Wendy_avatar_1462506024-96x96.jpg"},"category":[{"mID":"7",币期货已经期满。在这只期货上线期间，比特币交易市场并不平稳，这一加密货币的价格一度跌破10000美元。\r\n\r\n\r\n\r\n这只期...","image":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2018/01/201801190228085176-380x228.jpg","content":"","author_info":{"mID":"14582","name":"王雯敏Wendy","display_name":"Wendy","desc":"","bitcoin_address":"","avatar":"http://7fvhfe.com1.z0.glb.clouddn.com/wp-content/uploads/2016/05/王雯敏Wendy_avatar_1462506024-96x96.jpg"},"category":[{"mID":"7","name":"比特币"}],"replies":"2","getViews":"9203","source":""}]
     */

    private AuthorInfoBean author_info;

    private int refresh_number;//返回刷新的数量 默认是0
    /**
     * vc_info : {"count":274,"amount":336578.77,"blockchain_count":91}
     */



    public int getRefresh_number() {
        return refresh_number;
    }

    public void setRefresh_number(int refresh_number) {
        this.refresh_number = refresh_number;
    }

    public AuthorInfoBean getAuthor_info() {
        return author_info;
    }

    public void setAuthor_info(AuthorInfoBean author_info) {
        this.author_info = author_info;
    }


    public static class AuthorInfoBean {
        /**
         * desc : 趣会翻译编辑，邮箱wendy@8btc.com，微信号wendyes，欢迎提供比特币和区块链资讯信息。比特币地址：1AAjfpii34M4SHe8YbY45Tx32pd6TT2weZ
         * post_count : 1419
         * comment_count : 4235
         * support_count : 15
         */

        private String desc;
        private int post_count;
        private int comment_count;
        private int support_count;
        private int is_viking;
        private int views_count;

        public int getViews_count() {
            return views_count;
        }

        public void setViews_count(int views_count) {
            this.views_count = views_count;
        }

        public int getIs_viking() {
            return is_viking;
        }

        public void setIs_viking(int is_viking) {
            this.is_viking = is_viking;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public int getPost_count() {
            return post_count;
        }

        public void setPost_count(int post_count) {
            this.post_count = post_count;
        }

        public int getComment_count() {
            return comment_count;
        }

        public void setComment_count(int comment_count) {
            this.comment_count = comment_count;
        }

        public int getSupport_count() {
            return support_count;
        }

        public void setSupport_count(int support_count) {
            this.support_count = support_count;
        }
    }


    public List<ListBean> list;

    public List<ListBean> getList() {
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }


    public static class ListBean implements MultiItemEntity {
        /**
         * mID : 155397
         * title : 真的可以只有链没有币（Token）么？
         * post_date : 1516616068
         * post_date_format : 2018-01-22 10:14:28
         * desc : 最开始世界上本没有币圈和链圈之分，但是后来…
         * <p>
         * 今天我参加了csdn在北京办的区块链开发者沙龙，获益匪浅。所以这次，我不谈币价，就谈谈区块链。
         * <p>
         * 自从加入...
         * image : http://www.8btc.com/wp-content/uploads/2018/01/201801220213424754.jpg
         * content : 最开始世界上本没有币圈和链圈之分，但是后来…
         * author_info : {"mID":"4","name":"dkadll","display_name":"区块链资讯","desc":"","bitcoin_address":"","avatar":"http://www.8btc.com/wp-content/uploads/2015/10/区块链资讯_avatar_1445521708-96x96.png"}
         * category : [{"mID":"413","name":"区块链","desc":"2015年是区块链元年，过去一年来，趣会组织翻译了《数字巨链》、《比特币开发者指南》等区块链专著，译介了3000多篇区块链资讯与技术教程，引进普林斯顿、可汗学院、Udemy等比特币、区块链相关公开课视频，欢迎区块链技术爱好者加入我们。原创投稿 xiaoniu@8btc.com ；翻译投稿selene@8btc.com \r\n","link":"/blockchain"}]
         * replies : 0
         * getViews : 0
         * source :
         */
        public ExtraBean getExtra() {
            return extra;
        }

        public void setExtra(ExtraBean extra) {
            this.extra = extra;
        }

        /**
         * 目前有四种样式
         * 一张图片 包含三种样式
         * 三张图片 包含一种样式
         */
        public static final int Type1Normal = 1;
        public static final int Type1Video = 2;
        public static final int Type1Topic = 3;
        public static final int Type1Invest = 4;
        public static final int Type3 = 5; //三张图
        public static final int Type1Week = 6;
        private int id;
        private String title;
        private String post_name;

        public String getPost_name() {
            return post_name;
        }

        public void setPost_name(String post_name) {
            this.post_name = post_name;
        }

        public List<String> getImages() {
            return images;
        }

        public void setImages(List<String> images) {
            this.images = images;
        }

        private String post_date;
        private String post_date_format;
        private String desc;
        private String image;
        private String content;
        private AuthorInfoBean author_info;
        private String replies;
        private String views;
        private List<CategoryBean> category;
        @SerializedName("Images")
        private List<String> images;
        private boolean isSelected;//收藏列表编辑时是否选中
        private ExtraBean extra;
        private String post_type;

        public String getPost_type() {
            return post_type;
        }

        public void setPost_type(String post_type) {
            this.post_type = post_type;
        }

        public boolean isSelected() {
            return isSelected;
        }

        public void setSelected(boolean selected) {
            isSelected = selected;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getTitle() {
            return title.replaceAll("<em>|</em>","");
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getPost_date() {
            return post_date;
        }

        public void setPost_date(String post_date) {
            this.post_date = post_date;
        }

        public String getPost_date_format() {
            return post_date_format;
        }

        public void setPost_date_format(String post_date_format) {
            this.post_date_format = post_date_format;
        }

        public String getDesc() {
            return desc.replaceAll("<em>|</em>","");
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public String getImage() {
            return image;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public String getContent() {
            return content.replaceAll("<em>|</em>","");
        }

        public void setContent(String content) {
            this.content = content;
        }

        public AuthorInfoBean getAuthor_info() {
            return author_info;
        }

        public void setAuthor_info(AuthorInfoBean author_info) {
            this.author_info = author_info;
        }

        public String getReplies() {
            return replies;
        }

        public void setReplies(String replies) {
            this.replies = replies;
        }

        public String getViews() {
            return views;
        }

        public void setViews(String views) {
            this.views = views;
        }



        public List<CategoryBean> getCategory() {
            return category;
        }

        public void setCategory(List<CategoryBean> category) {
            this.category = category;
        }


        @Override
        public int getItemType() {
            if (images != null && images.size() >= 3) {
                return Type3;
            } else if (extra!=null&&extra.getTemplate()!=null&&extra.getTemplate().equals("single-theme.php")) {
                return Type1Topic;//专题
            } else if (category != null && category.size() != 0 && category.get(0).getId().equals("898")) {
                return Type1Week;//周刊
            } else if (extra != null && extra.getTemplate() != null && extra.getTemplate().equals("single-venture.php")) {
                return Type1Invest;//创投
            } else if (post_type!=null&& !TextUtils.isEmpty(post_type)&&post_type.equals("video")) {
                return Type1Video;//视频
            } else if (title.contains("视频|《8问》")){
                return Type1Video;//视频
            }else {
                return Type1Normal;
            }
        }

        public static class AuthorInfoBean {
            /**
             * mID : 4
             * name : dkadll
             * display_name : 区块链资讯
             * desc :
             * bitcoin_address :
             * avatar : http://www.8btc.com/wp-content/uploads/2015/10/区块链资讯_avatar_1445521708-96x96.png
             */

            private String id;
            private String name;
            private String display_name;
            private String desc;
            private String bitcoin_address;
            private String avatar;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getDisplay_name() {
                return display_name;
            }

            public void setDisplay_name(String display_name) {
                this.display_name = display_name;
            }

            public String getDesc() {
                return desc;
            }

            public void setDesc(String desc) {
                this.desc = desc;
            }

            public String getBitcoin_address() {
                return bitcoin_address;
            }

            public void setBitcoin_address(String bitcoin_address) {
                this.bitcoin_address = bitcoin_address;
            }

            public String getAvatar() {
                return avatar;
            }

            public void setAvatar(String avatar) {
                this.avatar = avatar;
            }
        }

        public static class CategoryBean {
            /**
             * mID : 413
             * name : 区块链
             * desc : 2015年是区块链元年，过去一年来，趣会组织翻译了《数字巨链》、《比特币开发者指南》等区块链专著，译介了3000多篇区块链资讯与技术教程，引进普林斯顿、可汗学院、Udemy等比特币、区块链相关公开课视频，欢迎区块链技术爱好者加入我们。原创投稿 xiaoniu@8btc.com ；翻译投稿selene@8btc.com
             * <p>
             * link : /blockchain
             */

            private String id;
            private String name;
            private String desc;
            private String link;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getDesc() {
                return desc;
            }

            public void setDesc(String desc) {
                this.desc = desc;
            }

            public String getLink() {
                return link;
            }

            public void setLink(String link) {
                this.link = link;
            }
        }
    }

    /**
     * 用于判断额外类型使用
     */
    public static class ExtraBean {

        private String template;
        //创投
        private String company;
        private String field;
        private String amount;
        private String round;
        private String area;
        private String investors;

        //专题
        private String theme_num;


        public String getTheme_num() {
            return theme_num;
        }

        public void setTheme_num(String theme_num) {
            this.theme_num = theme_num;
        }

        public String getTemplate() {
            return template;
        }

        public void setTemplate(String template) {
            this.template = template;
        }

        public String getCompany() {
            return company;
        }

        public void setCompany(String company) {
            this.company = company;
        }

        public String getField() {
            return field;
        }

        public void setField(String field) {
            this.field = field;
        }

        public String getAmount() {
            return amount;
        }

        public void setAmount(String amount) {
            this.amount = amount;
        }

        public String getRound() {
            return round;
        }

        public void setRound(String round) {
            this.round = round;
        }

        public String getArea() {
            return area;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public String getInvestors() {
            return investors;
        }

        public void setInvestors(String investors) {
            this.investors = investors;
        }


    }

    /**
     * 链创投代码合并
     */
    private VcInfoBean vc_info;
    public VcInfoBean getVc_info() {
        return vc_info;
    }

    public void setVc_info(VcInfoBean vc_info) {
        this.vc_info = vc_info;
    }


    public static class VcInfoBean {
        /**
         * count : 274
         * amount : 336578.77
         * blockchain_count : 91
         */

        private int count;
        private double amount;
        private int blockchain_count;

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }

        public double getAmount() {
            return amount;
        }

        public void setAmount(double amount) {
            this.amount = amount;
        }

        public int getBlockchain_count() {
            return blockchain_count;
        }

        public void setBlockchain_count(int blockchain_count) {
            this.blockchain_count = blockchain_count;
        }
    }
}
